GXContainsBoundsShape
You can use theGXContainsBoundsShape
function to determine if a rectangle contains a shape or a particular contour of a shape.
gxBoolean GXContainsBoundsShape(const gxRectangle *container, gxShape test, long index);
container
- A pointer to the rectangle to test as the container.
test
- A reference to the shape containing the contour to test for inclusion.
index
- The number of the contour to test for inclusion. You may specify a value of 0 to indicate you want to test the entire shape for inclusion.
- function result
- A Boolean value indicating whether the container rectangle contains
the specified contour of the test shape.DESCRIPTION
TheGXContainsBoundsShape
function returnstrue
as its function result if the rectangle specified by thecontainer
parameter contains the contour indicated by theindex
parameter of the shape specified by thetest
parameter and returnsfalse
otherwise.This function may return
true
even if the container rectangle and the indicated contour of the test shape share one or more edges.This function considers the shape fill, the style modifications, and the transform mapping of the test shape. Only areas that are drawn are considered when determining whether the container rectangle contains the specified contour.
If you provide a test shape that is not one of the geometric shape types, this function performs the actions described in the following table:
Shape type Action taken bitmap Compares bounding rectangle of bitmap picture Compares bounding rectangle of entire picture text Converts to path shape glyph Converts to path shape layout Converts to path shape ERRORS, WARNINGS, AND NOTICES
Errors out_of_memory shape_is_nil parameter_is_nil (debugging version) illegal_type_for_shape (debugging version) shape_operator_may_not_be_a_picture (debugging version) SEE ALSO
For a discussion of shape fills, see Chapter 2, "Geometric Shapes," in this book.For a discussion of style modifications, see Chapter 3, "Geometric Styles," in this book.
For a discussion of transform mappings, see the chapter "Transform Objects" of Inside Macintosh: QuickDraw GX Objects.
To determine if a rectangle touches a shape, use the
GXTouchesBoundsShape
function, described on page 4-97.To determine if a shape contains another shape, use the
GXContainsShape
function, described in the next section.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help